package com.lagou.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@RestController
// @Controller
@RequestMapping("/restful")
public class RestfulController {

    //@RequestMapping(value = "/user/{id}",method = RequestMethod.GET)
    //@ResponseBody
    @GetMapping("/user/{id}")
    public String findById(@PathVariable Integer id){
        return "<h1>findById" + id + "</h1>" ;
    }

    @PostMapping("/user")
    public String post(){
        return "post";
    }

    @PutMapping("/user")
    public String update(){
        return "put";
    }

    @DeleteMapping("/user/{id}")
    public String delete(@PathVariable Integer id){
        return "delete" + id ;
    }

}
